# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=acct
pkgver=6.6.4
pkgrel=0
pkgdesc="The GNU Accounting Utilities"
url="https://www.gnu.org/software/acct/"
arch="all"
license="GPL-3.0-or-later"
depends=""
makedepends="linux-headers"
install=""
subpackages="$pkgname-doc"
source="https://ftp.gnu.org/gnu/acct/$pkgname-$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

prepare() {
	default_prepare
	sed -i -e '/gets is a/d' \
		"$builddir"/lib/stdio.in.h
}

build() {
	cd "$builddir"
	# seems like this makefile does not respect DESTDIR
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--mandir="$pkgdir"/usr/share/man \
		--infodir="$pkgdir"/usr/share/info \
		--enable-linux-multiformat
	make LDADD="-lm lib/libgnu.la"
}

package() {
	cd "$builddir"
	make prefix="$pkgdir/usr" install
}

sha512sums="413aa446caece8fd773c92e2995bbaa034f63dd0ced521815a676c49f118e02982862b9c0ab7e60be5212c87d1e82ba6325bda212cf4857392a068d359a1e2c2  acct-6.6.4.tar.gz"
